
from typing import Any, Dict, List

from core.globals import site
from fastapi_amis_admin import admin
from fastapi_amis_admin.admin import (
    AdminApp,
    FieldPermEnum,
    RecentTimeSelectPerm,
    SimpleSelectPerm,
    UserSelectPerm,
)
from fastapi_amis_admin.amis.components import PageSchema, TableColumn
from fastapi_amis_admin.crud.parser import LabelField, PropertyField
from fastapi_amis_admin.models import Field
from fastapi_user_auth.auth.models import User
from fastapi_user_auth.mixins.admin import AuthFieldModelAdmin, AuthSelectModelAdmin
from pydantic import BaseModel
from sqlmodel.sql.expression import Select
from starlette.requests import Request

from backend.apps.blog.models import Article, ArticleStatus, Category, Tag

@site.register_admin
class BlogApp(admin.AdminApp):
    page_schema = PageSchema(label="博客应用", icon="fa fa-wordpress")
    router_prefix = "/blog"

    def __init__(self, app: "AdminApp"):
        super().__init__(app)
        self.register_admin(CategoryAdmin, ArticleAdmin, TagAdmin)